using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;

namespace UserManagementService.Users;

/// <summary>
/// 获取用户列表输入DTO
/// </summary>
public class GetUserListInput : PagedAndSortedResultRequestDto
{
    /// <summary>
    /// 筛选条件（用户名、邮箱、姓名、姓氏）
    /// </summary>
    public string Filter { get; set; }

    /// <summary>
    /// 是否激活
    /// </summary>
    public bool? IsActive { get; set; }

    /// <summary>
    /// 开始时间
    /// </summary>
    public DateTime? StartTime { get; set; }

    /// <summary>
    /// 结束时间
    /// </summary>
    public DateTime? EndTime { get; set; }
}

/// <summary>
/// 设置密码输入DTO
/// </summary>
public class SetPasswordDto
{
    /// <summary>
    /// 密码
    /// </summary>
    [Required]
    [StringLength(128, MinimumLength = 6)]
    public string Password { get; set; }
}

/// <summary>
/// 修改密码输入DTO
/// </summary>
public class ChangePasswordDto
{
    /// <summary>
    /// 旧密码
    /// </summary>
    [Required]
    public string OldPassword { get; set; }

    /// <summary>
    /// 新密码
    /// </summary>
    [Required]
    [StringLength(128, MinimumLength = 6)]
    public string NewPassword { get; set; }

    /// <summary>
    /// 确认密码
    /// </summary>
    [Required]
    [StringLength(128, MinimumLength = 6)]
    [Compare(nameof(NewPassword))]
    public string ConfirmPassword { get; set; }
}

/// <summary>
/// 授予权限输入DTO
/// </summary>
public class GrantPermissionDto
{
    /// <summary>
    /// 权限名称
    /// </summary>
    [Required]
    public string PermissionName { get; set; }
}

/// <summary>
/// 撤销权限输入DTO
/// </summary>
public class RevokePermissionDto
{
    /// <summary>
    /// 权限名称
    /// </summary>
    [Required]
    public string PermissionName { get; set; }
}